package org.example.myleet.p763;

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Map<String, List<Integer>> inputs = new HashMap<>();
        inputs.put("", Collections.emptyList());
        inputs.put("ababcbacadefegdehijhklij", Arrays.asList(9,7,8));
        inputs.put("abcdefg", Arrays.asList(1,1,1,1,1,1,1));
        inputs.put("ababcbacada", Arrays.asList(11));
//        Solution solution = new Solution();
        Solution2 solution = new Solution2();
        for (Map.Entry<String, List<Integer>> entry : inputs.entrySet()) {
            List<Integer> answer = solution.partitionLabels(entry.getKey());
            for (int i = 0; i < answer.size(); i++) {
                if (!entry.getValue().get(i).equals(answer.get(i))) {
                    throw new RuntimeException("answer does not match!");
                }
            }
        }
        System.out.println("finish");
    }
}
